package com.xingkeduo.pojo.table;

import com.xingkeduo.util.pojo.base.BaseEnum;
import com.xingkeduo.util.pojo.base.BaseTable;
import org.apache.ibatis.type.Alias;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 求职者账户类
 *
 * @author 高杰
 * @time 2018年12月24日 下午3:52:02
 * @description
 */
@Alias("Jobseeker")
public class JobseekerTO extends BaseTable<JobseekerTO> {
    /**
     * 状态枚举
     *
     * @author 高杰
     * @time 2018年12月25日 下午5:38:29
     * @description
     */
    public enum Status implements BaseEnum {
        TEST1RESERVE(10, "初试储备"),
        TEST2RESERVE(11, "复试储备"),
        TEST1ELIMINATE(20, "初试淘汰"),
        TEST2ELIMINATE(21, "复试淘汰"),
        INIT(25, "填写信息"),
        TEST1(30, "待初试"),
        TEST2(40, "待复试"),
        GRADUATION(60, "毕业");

        private int value;
        private String desc;

        private Status(int value, String desc) {
            this.value = value;
            this.desc = desc;
        }

        public static boolean validValue(String value) {
            int value_int = Integer.parseInt(value);
            return validValue(value_int);
        }

        public static boolean validValue(int value) {
            Status[] statuses = Status.values();
            for (int i = 0; i < statuses.length; i++) {
                if (statuses[i].getValue() == value)
                    return true;
            }
            return false;
        }

        public static Status getStatus(String value) {
            int value_int = Integer.parseInt(value);
            return getStatus(value_int);
        }

        public static Status getStatus(int value) {
            Status[] statuses = Status.values();
            for (int i = 0; i < statuses.length; i++) {
                if (statuses[i].getValue() == value)
                    return statuses[i];
            }
            return null;
        }

        @Override
        public int getValue() {
            return value;
        }

        public String getDesc() {
            return desc;
        }
    }

    /**
     * 类型枚举
     *
     * @author 高杰
     * @time 2018年12月25日 下午5:38:36
     * @description
     */
    public enum Type implements BaseEnum {
        EMPLOYYEE(1, "二线"), HAIRCUT(2, "发型师");

        private int value;
        private String desc;

        private Type(int value, String desc) {
            this.value = value;
            this.desc = desc;
        }

        public int getValue() {
            return value;
        }

        public String getDesc() {
            return desc;
        }
    }

    protected String login;
    protected String wechatName;
    protected String unionId;
    protected String password;
    private Status status;
    private Type type;

    private Date outTime;

    private JobseekerSocialTO social;
    private JobseekerJobTO job;
    private List<JobseekerAssessTO> assesses;

    private Map<String,Integer> jobseekerScore;

    //更换成数组了,淘汰也要显示了
    //初试
    private JobseekerAssessTO lastFirstExam;
    //复试
    private JobseekerAssessTO lastSecondExam;

    //初试复试集合
    private List<JobseekerAssessTO> assessList;

    private List<JobseekerJobDetailTO> jobDetailList;

    //培训信息
    private JobseekerAssessTO assessTO;

    public JobseekerAssessTO getAssessTO() {
        return assessTO;
    }

    public JobseekerTO setAssessTO(JobseekerAssessTO assessTO) {
        this.assessTO = assessTO;
        return this;
    }

    public List<JobseekerAssessTO> getAssessList() {
        return assessList;
    }

    public JobseekerTO setAssessList(List<JobseekerAssessTO> assessList) {
        this.assessList = assessList;
        return this;
    }

    public Date getOutTime() {
        return outTime;
    }

    public JobseekerTO setOutTime(Date outTime) {
        this.outTime = outTime;
        return this;
    }

    public List<JobseekerJobDetailTO> getJobDetailList() {
        return jobDetailList;
    }

    public JobseekerTO setJobDetailList(List<JobseekerJobDetailTO> jobDetailList) {
        this.jobDetailList = jobDetailList;
        return this;
    }

    public String getUnionId() {
        return unionId;
    }

    public JobseekerTO setUnionId(String unionId) {
        this.unionId = unionId;
        return this;
    }

    public String getLogin() {
        return login;
    }

    public JobseekerTO setLogin(String login) {
        this.login = login;
        return this;
    }

    public String getWechatName() {
        return wechatName;
    }

    public JobseekerTO setWechatName(String wechatName) {
        this.wechatName = wechatName;
        return this;
    }

    public String getPassword() {
        return password;
    }

    public JobseekerTO setPassword(String password) {
        this.password = password;
        return this;
    }

    public Status getStatus() {
        return status;
    }

    public JobseekerTO setStatus(Status status) {
        this.status = status;
        return this;
    }

    public Type getType() {
        return type;
    }

    public JobseekerTO setType(Type type) {
        this.type = type;
        return this;
    }

    public JobseekerSocialTO getSocial() {
        return social;
    }

    public JobseekerTO setSocial(JobseekerSocialTO social) {
        this.social = social;
        return this;
    }

    public JobseekerJobTO getJob() {
        return job;
    }

    public JobseekerTO setJob(JobseekerJobTO job) {
        this.job = job;
        return this;
    }

    public List<JobseekerAssessTO> getAssesses() {
        return assesses;
    }

    public JobseekerTO setAssesses(List<JobseekerAssessTO> assesses) {
        this.assesses = assesses;
        return this;
    }

    public JobseekerAssessTO getLastFirstExam() {
        return lastFirstExam;
    }

    public JobseekerTO setLastFirstExam(JobseekerAssessTO lastFirstExam) {
        this.lastFirstExam = lastFirstExam;
        return this;
    }

    public JobseekerAssessTO getLastSecondExam() {
        return lastSecondExam;
    }

    public JobseekerTO setLastSecondExam(JobseekerAssessTO lastSecondExam) {
        this.lastSecondExam = lastSecondExam;
        return this;
    }

    public Map<String, Integer> getJobseekerScore() {
        return jobseekerScore;
    }

    public void setJobseekerScore(Map<String, Integer> jobseekerScore) {
        this.jobseekerScore = jobseekerScore;
    }

    @Override
    public String toString() {
        return "JobseekerTO{" +
                "login='" + login + '\'' +
                ", unionId='" + unionId + '\'' +
                ", password='" + password + '\'' +
                ", status=" + status +
                ", type=" + type +
                ", wechatName='" + wechatName + '\'' +
                ", social=" + social +
                ", job=" + job +
                ", assesses=" + assesses +
                ", lastFirstExam=" + lastFirstExam +
                ", lastSecondExam=" + lastSecondExam +
                '}';
    }
}
